﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
using System.Data;

namespace IHISCETeim.Web.MachineSys.UserModel
{
    public partial class UQuestionnaireReport : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.查看 };
            }
        }
        protected override string DWZRef
        {
            get
            {
                return "UQuestionnaireReport";
            }
        }
        #region 属性 (查询条件)


      
        protected string CreateDateFrom
        {
            get
            {
                return GetRequestValue<string>("CreateDateFrom", DateTime.Now.ToString("yyyy-MM-01"));
            }
        }

        protected string CreateDateTo
        {
            get
            {
               
                 return GetRequestValue<string>("CreateDateTo",Convert.ToDateTime(CreateDateFrom).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd"));
                //  return _temp.IsEmptyOrNull() ? CreateDateFrom.IsEmptyOrNull() ? "" : Convert.ToDateTime(CreateDateFrom).AddDays(1).ToString("yyyy-MM-dd") :  CreateDateFrom.IsEmptyOrNull()?"":_temp;
            }
        }

        protected int ParId
        {
            get
            {
                return GetRequestValue<int>("ParId", 1);
            }
        }

        protected string GetUQuestionnaireTop()
        {
            List<UQuestionTempleteInfo> list= UWarrantyCardController.GetAllUQuestionTempleteByParId(0);
            string optionhtmltemp = "<option value='{0}' {2} >{1}</option>";
            string htmlstr = "";
            foreach (UQuestionTempleteInfo item in list)
            {              
                htmlstr += string.Format(optionhtmltemp, item.UQTID, item.Title, item.UQTID == ParId ? "selected" : "");
            }
            return htmlstr;
        }


        #endregion
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}